/**
 * This is the test-case created to simulate the wrinkle call effect discussed
 */
#include "syscall.h"

int lockId,cvId,threadId=0;

void function()
{
	Print1("Thread %d is forked\n",threadId);
	Print1("Thread %d is going to wait infinitely to simulate wrinkle condition\n",threadId);
	Acquire(lockId);
	Wait(cvId,lockId);
}

void function2()
{
	threadId=threadId+1;
	Print1("Thread %d is forked\n",threadId);
	Exit(0);

}

int main()
{
	Print("Inside wrinkle executable file\n");
	lockId = CreateLock((char *)"wrinkleLock",11);
	cvId = CreateCondition((char *)"wrinkleCV",9);
	Fork(function);
	Fork(function2);
	Yield();
	Yield();
	Yield();
	Exit(0);
}
